@extends('backstage.layout.master')
@section('title', '模块管理')
@section('style')
    <style>
        a{
           cursor: pointer;
        }
    </style>
@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>
            <li class="active">
                模块管理
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-content">
                    <div class="page-header">
                        <h1>
                            模块管理
                        </h1>
                    </div><!-- /.page-header -->

                    <div class="row">
                        <div class="col-xs-12" style="margin-bottom: 20px;">
                            请选一个模块:
                            <select>
                                <option selected>发现页模块</option>
                            </select>
                            <a href="backstage/module/add-module"><button class="btn btn-danger add-btn-danger" style="float: right;">新增模块</button></a>
                        </div>

                        <div class="col-xs-12">
                            <!-- PAGE CONTENT BEGINS -->
                            <div class="table-responsive">
                                <table id="sample-table-2" class="table table-striped table-bordered table-hover">
                                    <thead>
                                    <tr>
                                        <th>降序排列</th>
                                        <th>编号</th>
                                        <th>模块名称</th>
                                        <th>关联模块</th>
                                        <th>
                                            <i class="icon-time bigger-110 hidden-480"></i>
                                            创建时间
                                        </th>
                                        <th>显示</th>
                                        <th>操作</th>
                                    </tr>
                                    </thead>

                                    <tbody>
                                    @foreach ($find_modules as $find_module)
                                        <tr>
                                            <td style="width:68px;">
                                                <input type="text" name="sort" value="{{$find_module->sort}}" class="sort" style="width:50px;" data="{{$find_module->sort}}" data-module-id="{{$find_module->find_module_id}}" onblur="updateModule(this,2);">
                                            </td>
                                            <td>
                                                {{$find_module->find_module_id}}
                                            </td>
                                            <td>
                                                {{$find_module->find_module_name}}
                                            </td>
                                            <td>
                                                {{$find_module->app_cn_name}}
                                            </td>
                                            <td>
                                                {{date('Y-m-d H:i:s',$find_module->updated_at)}}
                                            </td>
                                            <td>
                                                <input type="checkbox" @if($find_module->is_show == 1) checked @endif data="{{$find_module->is_show}}" data-module-id="{{$find_module->find_module_id}}" onchange="updateModule(this,1);">
                                            </td>
                                            <td>
                                                <a @if($find_module->app_id == 1 || $find_module->app_id == 10)
                                                   @if($find_module->app_id == 1) href="backstage/carousels/list" @else href="backstage/announcements/list" @endif
                                                @else href="backstage/module/add-data/{{$find_module->find_module_id}}" @endif class="green">添加资源</a>
                                                <a @if($find_module->app_id == 1 || $find_module->app_id == 10)
                                                   @if($find_module->app_id == 1) href="backstage/carousels/list" @else href="backstage/announcements/list" @endif
                                               @else href="backstage/module/data-list/{{$find_module->find_module_id}}" @endif class="blue">资源列表</a>
                                                <a href="backstage/module/update/{{$find_module->find_module_id}}" class="blue">编辑</a>
                                                <a href="javascript:;" class="red" data-module-id="{{$find_module->find_module_id}}" onclick="updateModule(this,3);">删除</a>
                                            </td>
                                        </tr>
                                    @endforeach
                                    </tbody>
                                </table>
                            </div>
                            <div class="row">
                                <div>
                                    <div class="dataTables_paginate paging_bootstrap">

                                    </div>
                                </div>
                            </div>
                            <!-- PAGE CONTENT ENDS -->
                        </div><!-- /.col -->
                    </div><!-- /.row -->
                </div><!-- /.page-content -->
            </div>
        </div>
    </div>
@stop
@section('script')
    <script src="backstage/js/module/module_list.js"></script>
@stop